package cn.dt.ymcc.feigclient;

import cn.dt.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignClientFallbackFactory implements FallbackFactory<MediaFeignClient> {
    @Override
    public MediaFeignClient create(Throwable throwable) {
        return new MediaFeignClient() {
            @Override
            public JSONResult searchChepterMedia(Long chapterId) {
                return JSONResult.error("视频服务不可达，请检查视频服务");
            }
        };
    }
}
